<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/common/head.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
	<head>
		  <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="renderer" content="webkit">

    <title>写日志</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link href="${resource }/css/bootstrap.css" rel="stylesheet">
<link href="${resource }/font-awesome/css/font-awesome.css?v=4.3.0"
	rel="stylesheet">
<link href="${resource }/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="${resource }/css/animate.css" rel="stylesheet">
<!--富文本编辑器-->
<link rel="stylesheet" type="text/css"
	href="${resource }/css/plugins/simditor/simditor.css" />
<!--webuploader-->
<link rel="stylesheet" type="text/css"
	href="${resource }/css/plugins/webuploader/webuploader.css">
<link rel="stylesheet" type="text/css"
	href="${resource }/css/demo/webuploader-demo.css">
<link href="${resource }/css/style.css?v=2.2.0" rel="stylesheet">
<link rel="stylesheet" href="${resource }/css/notices.css" />
	</head>
	<body style="background-color: #f3f3f4;">
       <h3> 写日志</h3>
       <div class="mail-box">
      <div class="row wrapper border-bottom white-bg page-heading">
		<div class="row">
			<div class="col-lg-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>
							日志 <small>新建日志</small>
						</h5>
						<div class="ibox-tools">
							<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
							</a> <a class="dropdown-toggle" data-toggle="dropdown"
								href="form_basic.html#"> <i class="fa fa-wrench"></i>
							</a> <a class="close-link"> <i class="fa fa-times"></i>
							</a>
						</div>
					</div>
					<div class="ibox-content">
						<div class="form-horizontal">
							<div class="mail-body">

                                <form class="form-horizontal" method="post" action="addDo.do">
                                    <div class="form-group">
                                        <label class="col-sm-4 control-label">主题：</label>

                                        <div class="col-sm-10">
                                            <input type="text" id="logTitle" class="form-control" value="" name="logTitle">
                                        </div>
                                    </div>
                                     <div class="form-group">
                                        <label class="col-sm-4 control-label">类别：</label>

                                        <div class="col-sm-10">
                                             <input type="radio" name="isPerson" value="1"/>个人日志
                                             <input type="radio" name="isPerson" value="0"/>工作日志
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="col-sm-4 control-label">可见权限：</label>

                                        <div class="col-sm-10">
                                             <input type="radio" name="isVisual" value="3"/>可见
                                             <input type="radio" name="isVisual" value="2"/>不可见
                                             <input type="radio" name="isVisual" value="1"/>仅自己
                                             <input type="radio" name="isVisual" value="0"/>所有人
                                        </div>
                                    </div>
                                </form>

                            </div>
							</div>

							<div class="col-lg-12">
								<div class="ibox float-e-margins">
									<div class="ibox-title">
										<h5>内容</h5>
										<div class="ibox-tools">
											<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
											</a> <a class="close-link"> <i class="fa fa-times"></i>
											</a>
										</div>
									</div>
									<div class="ibox-content">
										<textarea id="editor">
									    	${notice.noticeInfo }                     
		                               </textarea>
									</div>
								</div>
							</div>

							<div class="row">
								<div class="col-lg-12">
									<div class="ibox float-e-margins">
										<div class="ibox-title">
											<h5>附件</h5>
											<div class="ibox-tools">
												<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
												</a> <a class="close-link"> <i class="fa fa-times"></i>
												</a>
											</div>
										</div>
										<div class="ibox-content">
											<div class="page-container">
												<p>您可以尝试文件拖拽，使用QQ截屏工具，然后激活窗口后粘贴，或者点击添加图片按钮，来上传附件</p>
												<div id="uploader" class="wu-example">
													<div class="queueList">
														<div id="dndArea" class="placeholder">
															<div id="filePicker"></div>
															<p>或将照片拖到这里，单次最多可选300张</p>
														</div>
													</div>
													<div class="statusBar" style="display: none;">
														<div class="progress">
															<span class="text">0%</span> <span class="percentage"></span>
														</div>
														<div class="info"></div>
														<div class="btns">
															<div id="filePicker2"></div>
															<div class="uploadBtn">开始上传</div>
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<div class="col-sm-4 col-sm-offset-2">
									<button id="save" class="btn btn-primary" type="button" onclick="add()">保存内容</button>
									<button id="cancle" class="btn btn-white" type="button">取消</button>
								</div>
							</div>
						</div>
						<!-- 		</form> -->
					</div>
				</div>
			</div>
		</div>
	</div>

    <!-- Mainly scripts -->
    <script src="${resource }/js/jquery-2.1.1.min.js"></script>
	<script src="${resource }/js/bootstrap.min.js?v=3.4.0"></script>
	<script src="${resource }/js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script
		src="${resource }/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
	<!-- Custom and plugin javascript -->
	<script src="${resource }/js/hplus.js?v=2.2.0"></script>
	<script src="${resource }/js/plugins/pace/pace.min.js"></script>
	<!-- iCheck -->
	<script src="${resource }/js/plugins/iCheck/icheck.min.js"></script>
	<!-- simditor -->
	<script type="text/javascript"
		src="${resource }/js/plugins/simditor/module.js"></script>
	<script type="text/javascript"
		src="${resource }/js/plugins/simditor/uploader.js"></script>
	<script type="text/javascript"
		src="${resource }/js/plugins/simditor/hotkeys.js"></script>
	<script type="text/javascript"
		src="${resource }/js/plugins/simditor/simditor.js"></script>

	<script type="text/javascript" src="${resource }/js/editNotice.js"></script>
	<script>
		$(document).ready(function() {
			$('.i-checks').iCheck({
				checkboxClass : 'icheckbox_square-green',
				radioClass : 'iradio_square-green',
			});
		});
	</script>
	<script>
		$(document).ready(function() {
			var editor = new Simditor({
				textarea : $('#editor'),
			});
		});
	</script>
    <script>
    
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });


           /*  $('.summernote').summernote({
                lang: 'zh-CN'
            }); */

        });
        var save = function () {
            var aHTML = $('.click2edit').code(); //save HTML If you need(aHTML: array).
            $('.click2edit').destroy();
        };
        function add() {
            var logTitle=document.getElementById("logTitle").value;
            var logInfo =document.getElementById("editor").value;
            var radios = document.getElementsByName("isPerson");
            var isPerson;
            for(var i=0;i<radios .length;i++){
	            if(radios[i].checked){
	            	isPerson = radios[i].value;
	            break;
	            }
            }
            var radios = document.getElementsByName("isVisual");
            var isVisual;
            for(var i=0;i<radios .length;i++){
	            if(radios[i].checked){
	            	isVisual = radios[i].value;
	            break;
	            }
            }
			$.ajax({

				type: 'post',
				url: 'addDo.do',
				data:{"logTitle":logTitle,"isPerson":isPerson,"isVisual":isVisual,"logInfo":logInfo},
				success: function (data) {
					
						window.location.href='showMe.do';
						
					
				}
			});
		}
    </script>

	</body>
</html>
